package com.shenmazong.proxy;

/**
 * @program: server-java-demo
 * @description: MarryPersonProxy
 * @author: 亮子说编程
 * @create: 2020-10-15 12:06
 **/
public class MarryPersonProxy implements IMarry {

    private IMarry target;

    public MarryPersonProxy(MarryPerson person) {
        this.target = person;
    }

    public void doMarry() {
        doUnknow();
        doLove();
        target.doMarry();
        doLeave();
        doUnknow();
    }

    private void doUnknow() {
        System.out.println("我们是陌生人");
    }

    private void doLove() {
        System.out.println("我们相爱了");
    }

    private void doLeave() {
        System.out.println("我们离婚了");
    }
}
